home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / mail / smail-3.1.28 / src / version.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-08-08  |  1.8 KB  |  75 lines

  1. /* @(#)src/version.c    1.7 8/8/92 19:30:55 */
  2.  
  3. /*
  4.  *    Copyright (C) 1987, 1988 Ronald S. Karr and Landon Curt Noll
  5.  *    Copyright (C) 1992  Ronald S. Karr
  6.  * 
  7.  * See the file COPYING, distributed with smail, for restriction
  8.  * and warranty information.
  9.  */
  10.  
  11. /*
  12.  * version:
  13.  *    return the current smail version
  14.  */
  15. #include <stdio.h>
  16. #include "defs.h"
  17. #include "version.h"
  18. #ifndef DEPEND
  19. # include "extern.h"
  20. #endif
  21.  
  22. /*
  23.  * version - keep track of the smail version number
  24.  *
  25.  * The bat's eyes are intended to denote the origin of this source.  We
  26.  * ask that you follow the convention below:
  27.  *
  28.  *    /\--/\    from namei.uucp, e-.uucp and their down stream feeds
  29.  *    /\o-/\  half baked smail from amdahl.com (obsolete)
  30.  *    /\=-/\    as sent to Alpha sites
  31.  *    /\==/\  as sent to Beta sites
  32.  *    /\../\  as released with UTS
  33.  *    /\oo/\  as posted to Usenet
  34.  *    /\$$/\  from the Free Software Foundation (assuming they take it)
  35.  *    /\@@/\  with VHS routing
  36.  *
  37.  * The most likely case is that the bat's eyes in your version is correct.
  38.  * We suggest that you leave them alone unless you know differently.
  39.  *
  40.  * external functions:
  41.  *    version
  42.  */
  43. char *version_number = VERSION;
  44. char *release_date = RELEASE_DATE;
  45. char *patch_number = PATCH_NUMBER;
  46. char *patch_date = PATCH_DATE;
  47. char *bat = "/\\==/\\";            /* the proper bat for this release */
  48.  
  49. static char *our_version = NULL;    /* no version in the beginning */
  50.  
  51. char *
  52. version()
  53. {
  54.     /*
  55.      * form the version string for the first time if needed
  56.      */
  57.     if (our_version == NULL) {
  58.     our_version = xmalloc(sizeof(" Smail #.dddddd") +
  59.                   strlen(bat) +
  60.                   strlen(version_number) +
  61.                   strlen(patch_number));
  62.     (void) sprintf(our_version,
  63.                "%s Smail%s #%s.%d",
  64.                bat,
  65.                version_number,
  66.                patch_number,
  67.                compile_num);
  68.     }
  69.  
  70.     /*
  71.      * return the version string
  72.      */
  73.     return our_version;
  74. }
  75.